package com.woniu.project.client;

import com.woniu.project.core.dto.ResultDto;
import com.woniu.project.params.productproperty.ProdcutPropertyAddParam;
import com.woniu.project.params.productproperty.ProdcutPropertySelectParam;
import com.woniu.project.params.productproperty.ProdcutPropertyUpdateParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@FeignClient(name = "product-server")
public interface ProductPropertyClient {
    //根据是否有id和name进行不同的分页查询
    @GetMapping("/pawn/product/productProperty/select")
    public ResultDto select(@RequestBody ProdcutPropertySelectParam prodcutPropertySelectParam);

    //根据商品实体id查询商品属性
    @GetMapping("/pawn/product/productProperty/selectByEntityId")
    public ResultDto selectByEntityId(@RequestParam Integer id);

    //新增商品属性
    @PostMapping("/pawn/product/productProperty/addProperty")
    public ResultDto addProperty(@Valid @RequestBody ProdcutPropertyAddParam prodcutPropertyAddParam);

    //修改商品属性
    @PutMapping("/pawn/product/productProperty/updateProperty")
    public ResultDto updateProperty(@Valid @RequestBody ProdcutPropertyUpdateParam prodcutPropertyUpdateParam);

    //根据id删除属性
    @DeleteMapping("/pawn/product/productProperty/deleteById/{id}")
    public ResultDto deleteById(@PathVariable Integer id);
}
